﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/NoRightAd.Master" AutoEventWireup="true" CodeBehind="PostForSale.aspx.cs" Inherits="Foothill.Web.PostForSaleCodeBehind" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="post-common.css" type="text/css" />
    <link rel="stylesheet" href="post.css" type="text/css" /> 

    <script type="text/javascript">
        function redirectToUploadPhotoPage() {
            var url = 'UploadPhotoAsync.aspx';
            if (window.FormData === undefined) {
                url = 'PostForSaleUploadPhoto.aspx';
            }

            window.location.replace(url);
        }
    </script>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="cph1" runat="server">
    <ajaxToolkit:ToolkitScriptManager runat="Server" EnablePartialRendering="true" ID="ScriptManager1" />
    
    <div id="post-ad">
        <div id="post-ad-top">
            <table class="post-ad-steps">
                <tr>
                    <td class="current-step"><span class="step-num current-step-num">1</span>基本信息</td>
                    <td><span class="step-num other-step-num">2</span>添加照片</td>
                    <td><span class="step-num other-step-num">3</span>预览发布</td>
                </tr>
            </table>    
        </div>
        
        <div id="post-inner">
            <div>
                <div class="info-box">
                    汽车信息    
                </div>
                <asp:UpdatePanel ID="udpVechileInfo" runat="server" UpdateMode="Conditional" >
                    <Triggers>
                        <asp:PostBackTrigger ControlID="btnSubmit" />
                    </Triggers>
                    <ContentTemplate>
                        <table id="post-vehicle-info" class="ad-detail">
                            <tr>
                                <td>
                                    <asp:Label ID="lblMake" runat="server" CssClass="post-ad-label" Text="品牌" />
                                </td>    
                            </tr>
                            <tr>
                                <td>
                                    <ajaxToolkit:ComboBox ID="ddlMake" runat="server" AutoPostBack="true" MaxLength="150" 
                                        DropDownStyle="DropDownList" AutoCompleteMode="Append" CaseSensitive="false"
                                        OnSelectedIndexChanged="ddlMake_OnSelectedIndexChanged" CssClass="MakeComboBoxStyle" />
                                </td>
                            </tr>
                            <tr>
                                <td class="td-input-label">
                                    <asp:Label ID="lblModel" runat="server" Text="车型" CssClass="post-ad-label"  />   
                                </td>
                                <td class="td-input-label">
                                    <asp:Label ID="lblYear" runat="server" Text="年份" CssClass="post-ad-label" />  
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:DropDownList ID="ddlModel" runat="server" CssClass="ddlMake" />
                                </td>  
                                <td>
                                    <asp:DropDownList ID="ddlYear" runat="server" CssClass="ddlMake"/>    
                                </td>  
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblModelValidation" runat="server" CssClass="post-ad-validation" />     
                                </td>    
                            </tr>
                            <tr>
                                <td class="td-input-label">
                                    <asp:Label ID="lblCondition" runat="server" Text="车况" CssClass="post-ad-label" />
                                </td>
                                <td class="td-input-label">
                                    <asp:Label ID="lblTransmission" runat="server" Text="传动" CssClass="post-ad-label" />  
                                </td> 
                            </tr>
                            <tr>
                                <td>
                                    <asp:RadioButton ID="rbtNew" runat="server" GroupName="vehicleCondition" Text="全新" />
                                    <asp:RadioButton ID="rbtUsed" runat="server" GroupName="vehicleCondition" Text="二手" />
                                </td>
                                <td>
                                    <asp:RadioButton ID="rbtAutomatic" runat="server" GroupName="vehicleTransmission" Text="自动" />
                                    <asp:RadioButton ID="rbtStandard" runat="server" GroupName="vehicleTransmission" Text="手动" />
                                </td>        
                            </tr>
                            <tr>
                                <td class="td-input-label">
                                    <asp:Label ID="lblMileAge" runat="server" Text="里程" CssClass="post-ad-label" />  
                                    <span class="required-field">必填</span>    
                                </td>
                                <td class="td-input-label">
                                    <asp:Label ID="lblPrice" runat="server" Text="价格" CssClass="post-ad-label" />  
                                    <span class="required-field">必填</span>
                                </td> 
                            </tr>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtMileAge" runat="server" CssClass="post-ad-input" />
                                    <asp:Label ID="lblMileAgeTip" runat="server" CssClass="post-ad-tip" /> 
                                </td>
                                <td>
                                    <asp:TextBox ID="txtPrice" runat="server" CssClass="post-ad-input" />
                                    <asp:Label ID="lblPriceTip" runat="server" CssClass="post-ad-tip" /> 
                                </td>   
                            </tr>
                            <tr >
                                <td>
                                    <asp:Label ID="lblMileAgeValidation" runat="server" CssClass="post-ad-validation" />
                                </td>
                                <td>
                                    <asp:Label ID="lblPriceValidation" runat="server" CssClass="post-ad-validation" />
                                </td>
                            </tr>
                            <tr>
                                <td class="td-input-label">
                                    <asp:Label ID="lblDescription" runat="server" Text="简介" CssClass="post-ad-label" />        
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" Rows="8" CssClass="txtDescription" />    
                                    <ajaxToolkit:HtmlEditorExtender ID="hee1" runat="server" TargetControlID="txtDescription" 
                                        DisplaySourceTab="False" EnableSanitization="false">
                                        <Toolbar> 
                                            <ajaxToolkit:Bold />
                                            <ajaxToolkit:Italic />
                                            <ajaxToolkit:Underline />
                                            <ajaxToolkit:ForeColorSelector />
                                        </Toolbar>
                                    </ajaxToolkit:HtmlEditorExtender>
                                </td>    
                            </tr>
                            <tr >
                                <td colspan="2" class="td-validation"><asp:Label ID="lblDescriptionValidation" runat="server" CssClass="post-ad-validation" /></td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            
            <div id="seller-info" class="info-box">
                卖家信息    
            </div>
                        
            <div> 
                <asp:UpdatePanel ID="udpContact" runat="server" UpdateMode="Conditional">
                    <Triggers>
                        <asp:PostBackTrigger ControlID="btnSubmit" />
                    </Triggers>
                    <ContentTemplate>       
                        <table class="ad-detail">
                            <tr>
                                <td class="td-input-label">
                                    <asp:Label ID="lblListingType" runat="server" Text="卖家" CssClass="post-ad-label" />
                                </td>
                                <td />
                            </tr>
                            <tr>
                                <td>
                                    <asp:RadioButton ID="rbtListingTypeOwner" runat="server" GroupName="ListingType" Text="车主" Checked="true" />
                                    <asp:RadioButton ID="rbtListingTypeDealer" runat="server" GroupName="ListingType" Text="车行" />
                                </td>  
                                <td />   
                            </tr>
                            <tr>
                                <td class="td-input-label">
                                    <asp:Label ID="lblContactName" runat="server" Text="联系人" CssClass="post-ad-label" />
                                </td> 
                                <td class="td-input-label">
                                    <asp:Label ID="lblCity" runat="server" Text="城市" CssClass="post-ad-label" />
                                </td>    
                            </tr>  
                            <tr>
                                <td>
                                    <asp:TextBox ID="tbxContactName" runat="server" CssClass="post-ad-input" />     
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlCity" runat="server" CssClass="ddlMake" />        
                                </td>    
                            </tr>                      
                            <tr>
                                <td class="td-input-label">
                                    <asp:Label ID="lblPhone" runat="server" Text="电话" CssClass="post-ad-label" />
                                </td>
                                <td class="td-input-label">
                                    <asp:Label ID="lblEmail" runat="server" Text="Email" CssClass="post-ad-label" />
                                    <span class="required-field">必填</span>
                                </td> 
                                <td>
                                    <asp:Label ID="lblPhoneValidation" runat="server" />    
                                </td>  
                            </tr>   
                            
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtPhone" runat="server" CssClass="post-ad-input" />       
                                </td> 
                                <td>
                                    <asp:TextBox ID="txtEmail" runat="server" CssClass="post-ad-input" />       
                                </td>   
                            </tr>   

                            <tr class="tr-validation">
                                <td />
                                <td>
                                    <asp:Label ID="lblEmailValidation" runat="server" CssClass="post-ad-validation" />    
                                </td> 
                            </tr>
                        </table>

                        <div id="new-post-submit">
                            <asp:LinkButton ID="btnSubmit" runat="server" Text="下一步" OnClick="btnSubmit_Click" class="btnSubmit"  />    
                        </div>                      
                        <div class="clear"></div>                     
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>      
        </div>       
    </div>
</asp:Content>
